home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_2 / tm240.zip / BINKLEY.BAT < prev    next >
DOS Batch File  |  1990-06-24  |  9KB  |  299 lines

  1. ECHO OFF
  2.  
  3. :RESET
  4. rem When messages are entered in TagMail,  TagMail will create files so that
  5. rem this batch file can process the outbound mail.  Here's a table of the
  6. rem files created:
  7.  
  8. rem Type of message     File name    contents
  9. rem Matrix Message      MATRIX.TAG   Nothing
  10. rem Echo Message        ECHO.LST     List of areas messages entered in
  11. rem Group Message       GROUP.ENT    Nothing
  12. rem Echo message        ECHO.TAG     Nothing, Only created if the message
  13. rem                                  area isnot found in the areas found.
  14.  
  15. rem we then use the IF EXIST function of MSDOS to decide if we need to 
  16. rem process outbound mail
  17.  
  18.  
  19. IF EXIST C:\TAG\TAGMAIL\GROUP.ENT GOTO GRPPACK
  20. IF EXIST C:\TAG\TAGMAIL\ECHO.LST GOTO PACK
  21. IF EXIST C:\TAG\TAGMAIL\MATRIX.TAG GOTO PACK
  22.  
  23. C:
  24. CD\TAG\BINKLEY
  25. rem I run timer to make sure my date and time are correct (Since DOS 3.2 had
  26. rem a bug with the date/time rollover at midnight)
  27. TIMER /S
  28. CLS
  29.  
  30. rem we run BinkleyTerm here
  31.  
  32. BT
  33.  
  34. Rem now we look at the errorlevels returned to see what we are supposed to do.
  35. rem Errorlevels of 1,3,12,20,24, and 96 should return directly to the bbs (GO
  36. rem to the end of the batch file).  Other errorlevels as defined in 
  37. Rem BINKLEY.EVT will do other functions.
  38.  
  39. IF ERRORLEVEL 163 GOTO MAINT2
  40. IF ERRORLEVEL 160 GOTO MIDNIGHT
  41. IF ERRORLEVEL 154 GOTO GRPASK
  42. IF ERRORLEVEL 153 GOTO MAINT
  43. IF ERRORLEVEL 150 GOTO MAILIN
  44. IF ERRORLEVEL 100 GOTO CLEARCOUNT
  45. IF ERRORLEVEL 97 GOTO RESET
  46. IF ERRORLEVEL 96 GOTO TAG
  47. IF ERRORLEVEL 80 GOTO TAGMAIL
  48. IF ERRORLEVEL 50 GOTO MAILIN
  49. IF ERRORLEVEL 30 GOTO TAG
  50. IF ERRORLEVEL 25 GOTO RESET
  51. IF ERRORLEVEL 24 GOTO TAG
  52. IF ERRORLEVEL 20 GOTO TAG
  53. IF ERRORLEVEL 13 GOTO RESET
  54. IF ERRORLEVEL 12 GOTO TAG
  55. IF ERRORLEVEL 10 EXIT
  56. IF ERRORLEVEL 3 EXIT
  57. EXIT
  58.  
  59. :TAGMAIL
  60. ECHO ATH1 > COM1
  61. Rem This is used to run TagMail in the local mode without logging on through
  62. Rem TAG.  in this example,  pressing F8 while Binkley is in it's unattended
  63. Rem mode will  bring you here (BT Errorlevel 80)
  64.  
  65. C:
  66. CD \TAG\TAGMAIL
  67. TAGMAIL -L
  68. GOTO RESET
  69.  
  70. :MIDNIGHT
  71. Rem You may or may not need this event,  This will occur only if a user is
  72. Rem not on the system at the midnight rollover.  This is used in conjunction
  73. Rem with the Timer program above to ensure the Date Rolls over at midnight.
  74.  
  75. ECHO ATH1 > COM1
  76. WAIT 1:10
  77. GOTO RESET
  78.  
  79. :MAILIN
  80. ECHO ATH1 > COM1
  81.  
  82. Rem When mail is recieved from another system, it needs to be processed.  This
  83. Rem example uses Qmail by Greg Dawson and Group (GroupMail) by System
  84. Rem Enhancement Associates (SEA).
  85.  
  86. C:
  87. CD \TAG\BINKLEY
  88. CLS
  89. ECHO PROCESSING RECIEVED MAIL
  90.  
  91. Rem first we do a GROUP IN to process any Group Mail we may have recieved.
  92. Rem If you are not using Group Mail, just place a Rem statement in front of 
  93. Rem the GROUP lines in this batch file.
  94.  
  95. GROUP IN 
  96.  
  97. Rem Then we have Qmail do it's stuff.  
  98.  
  99. QM TOSS SCAN PACK 
  100.  
  101. Rem if Qmail processed any mail,  it will exit with an errorlevel of 1 or
  102. Rem higher,  We check for this to figure out if we need to continue processing
  103. Rem for other recieved mail. 
  104.  
  105. IF ERRORLEVEL 1 GOTO CONTINUE
  106.  
  107. Rem And lastly,  we check to see if we have recieved the latest NODEDIFF file
  108. Rem used to update the nodelist file.  If we have then we jump to our 
  109. Rem nodelist processing area of this batch file.  If you don't want to
  110. Rem process the nodelist as it comes in,  place a Rem statement in front of
  111. Rem these lines except in the MAINT area.  This check is located here, In 
  112. Rem CONTINUE, and MAINT areas of this Batch file
  113.  
  114. IF EXIST C:\FILE\NET\NODEDIFF.A?? goto LISTPROC
  115. GOTO RESET
  116.  
  117. :CONTINUE
  118. C:
  119. CD \TAG\TAGMAIL
  120.  
  121. Rem if you are using the Mailwait program, remove the Rem statement in front
  122. Rem of the Mailwait - U command below,  This will tell Mailwait to update the
  123. Rem indexes of the messages in each area. 
  124.  
  125. REM MAILWAIT -U
  126.  
  127. Rem Check for NODEDIFF file as described above
  128.  
  129. IF EXIST C:\FILE\NET\NODEDIFF.A?? goto LISTPROC
  130. GOTO RESET
  131.  
  132. :GRPPACK
  133.  
  134. Rem This area of the Batch file is only called if somes one enters a Group
  135. Rem mail message on your system.
  136.  
  137. C:
  138. CD \TAG\BINKLEY
  139. CLS
  140. ECHO PROCESSING OUTBOUND GROUP MAIL
  141. GROUP OUT
  142.  
  143. :PACK
  144. ECHO ATH1 > COM1
  145.  
  146. Rem This area is called if a user enters an Echo mail or matrix mail message.
  147. Rem Since Qmail will ignore the area list parameter if the file doesn't exist,
  148. Rem and it packs Matrix Mail on the same run, we can make the call for both 
  149. Rem at the same time.
  150.  
  151. C:
  152. CD \TAG\BINKLEY
  153. CLS
  154. ECHO PROCESSING ALL OUTBOUND MAIL
  155. QM PACK SCAN -FC:\TAG\TAGMAIL\ECHO.LST
  156. C:
  157. CD \TAG\TAGMAIL
  158.  
  159. Rem again, If you are using Mailwait,  uncomment the next line.
  160.  
  161. REM MAILWAIT -U
  162.  
  163. Rem Now we delete the files that were used to deturmine if processing is
  164. Rem required.  If we don't do this,  we will go into a endless loop of mail
  165. Rem processing.
  166.  
  167. IF EXIST C:\TAG\TAGMAIL\GROUP.ENT   DEL C:\TAG\TAGMAIL\GROUP.ENT
  168. IF EXIST C:\TAG\TAGMAIL\MATRIX.TAG  DEL C:\TAG\TAGMAIL\MATRIX.TAG
  169. IF EXIST C:\TAG\TAGMAIL\ECHO.LST    DEL C:\TAG\TAGMAIL\ECHO.LST
  170. GOTO RESET
  171.  
  172. :GRPASK
  173.  
  174. Rem Group mail is based on the file Update request function of most mailers.
  175. Rem to get new messages for these conferences,  you must generate an update
  176. Rem request.  This area will do this processing.
  177.  
  178. C:
  179. CD \TAG\BINKLEY
  180. CLS
  181. ECHO DOING GROUP MAIL UPDATE REQUESTS
  182. GROUP OUT ASK
  183. QM PACK
  184. GOTO RESET
  185.  
  186. :MAINT
  187. ECHO ATH1 > COM1
  188.  
  189. Rem This area of the batch file runs once per day (Just after ZMH in this 
  190. Rem example).  Any processing that needs to be done only once a day can be
  191. Rem done here.
  192.  
  193. C:
  194. CD \TAG\TAGMAIL
  195.  
  196. Rem First we Renumber or TagMail Message Bases
  197. RENUMBER
  198.  
  199. Rem If you are using Mailwait, we then need to compile the mailwait indexes
  200. Rem by uncommenting the following:
  201.  
  202. REM MAILWAIT -C
  203.  
  204. C:
  205. CD \TAG\BINKLEY
  206.  
  207. Rem if you use the FILELIST program to build text file listings of your
  208. Rem downloadable files.  Uncomment the following lines.  This program will
  209. Rem also create the files needed to allow File requests from your system
  210. Rem Remember to change the MYFILES to something that would be unique to your
  211. Rem System to avoid sysops getting multiple MYFILES.LST file from different
  212. Rem Systems.
  213.  
  214. REM FILELIST -C -D50 -FC:\TAG\GFILES -O MYFILES.LST -K -U
  215. REM PKZIP -A MYFILES MYFILES.LST
  216.  
  217. Rem We scan ALL echo areas during this event to make sure we haven't missed
  218. Rem an area for one reason or another...  
  219.  
  220. QM SCAN PACK
  221. GOTO RESET
  222.  
  223. :MAINT2
  224. REM This happens once a week...
  225. ECHO ATH1 > COM1
  226. C:
  227. CD \TAG\BINKLEY
  228.  
  229. Rem I use Qmail to make a file request for the latest NODEDIFF file
  230.  
  231. QM PACK -SGET_DIFF
  232. GOTO RESET
  233.  
  234. :LISTPROC
  235. ECHO ATH1 > COM1
  236.  
  237. Rem When a new NODEDIFF file comes in,  It must be processed to build the
  238. Rem new updated nodelist.  This area of the Batch file does this processing:
  239.  
  240. Rem (the directory C:\FILE\NET is my Inbound Directory, C:\NODELIST is my
  241. Rem Nodelist directory)
  242.  
  243. C:
  244. CD \NODELIST
  245.  
  246. Rem Copy the nodediff.a?? file to the nodelist directory and delete it from
  247. Rem the inbound directory.
  248.  
  249. COPY C:\FILE\NET\NODEDIFF.A??
  250. DEL C:\FILE\NET\NODEDIFF.A??
  251.  
  252. Rem Un-arc the NODELIST.A?? and NODEDIFF.A?? files.  I use the -R option
  253. Rem of PKXARC to overwrite the files if they exist, and add the two file names
  254. Rem at the end so that nothing other than NODEDIFF.* and NODELIST.* files will
  255. Rem be extracted for security.
  256.  
  257. PKXARC -R NODE*.A* NODELIST.* NODEDIFF.*
  258.  
  259. Rem Run PARSELST to combine the Nodelist and Nodediff files and build the
  260. Rem NODELIST.IDX and NODELIST.DAT files used by Binkley, and the TAGMAIL.IDX
  261. Rem file used by TAGMail.
  262.  
  263. PARSELST
  264.  
  265. Rem Now update the TagMail nodelist index (TAGMAIL.IDX)
  266.  
  267. TAGIDX
  268.  
  269. Rem delete the old nodelist archives.
  270.  
  271. DEL NODELIST.A??
  272.  
  273. Rem OLDLIST is a program that will remove all old nodelists from the directory
  274. Rem and then optionally archive the nodelist with the correct A?? file name.
  275.  
  276. OLDLIST -A PKARC A
  277.  
  278. Rem Delete the nodediff file as we don't need it anymore.
  279.  
  280. DEL NODEDIFF.*
  281. GOTO RESET
  282.  
  283. :CLEARCOUNT
  284.  
  285. Rem this area is used at the start of each mail event.  It will remove the
  286. Rem call counter files from the outbound directory.  In this example, only
  287. Rem the net 120 counter files will be deleted.
  288.  
  289. DEL C:\TAG\OUTBOUND\0078*.$$?
  290. GOTO RESET
  291.  
  292. :TAG
  293. Rem this area returns control to TAG from this batch file.  DO NOT run any
  294. Rem programs in this area as it will change the Errorlevel returned to TAG.
  295.  
  296. C:
  297. CD\TAG
  298. :END
  299.